<ui:composition template="/WEB-INF/template/layoutPadrao.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="titulo">Novo Gestor</ui:define>
	
	<f:metadata>
		<f:viewParam name="gestor" value="#{cadastroGestorBean.gestor}" />
	</f:metadata>


	<ui:define name="corpo">
		<h:form>
			<h1>Novo Gestor</h1>
			<p:messages autoUpdate="true" closable="true" />

			<p:toolbar style="margin-top:20px">
				<p:toolbarGroup>
					<p:button value="Novo" outcome="/gestores/cadastroGestor" />
					<p:commandButton value="Salvar" id="botaoSalvar"
						action="#{cadastroGestorBean.salvar}" update="@form" />
				</p:toolbarGroup>

				<p:toolbarGroup align="right">
					<p:button value="Pesquisa" outcome="/gestores/pesquisaGestor" />
				</p:toolbarGroup>
			</p:toolbar>

			<p:panelGrid columns="2" id="painel"
				style="width:100%; margin-top:20px" columnClasses="rotulo, campo">

				<p:outputLabel value="Nome" for="nome" />
				<p:inputText id="nome" size="60" maxlength="80"
					value="#{cadastroGestorBean.gestor.nome}" />

				<p:outputLabel value="Departamento" for="depart" />
				<p:selectOneMenu id="depart"
					value="#{cadastroGestorBean.gestor.departamento}">
					<f:selectItem itemLabel=":: Selecione ::" />
					<f:selectItems value="#{cadastroGestorBean.tipoDepartamentos}"
						var="tipo" itemValue="#{tipo}" itemLabel="#{tipo}" />
				</p:selectOneMenu>

				<p:outputLabel value="Setor" for="setor" />
				<p:inputText id="setor" size="60" maxlength="80"
					value="#{cadastroGestorBean.gestor.setor}" />

			</p:panelGrid>


		</h:form>
	</ui:define>
</ui:composition>